<?php
namespace addon\friend_link\validate;
use app\common\validate\ValidateBase;
class FriendLink extends ValidateBase
{
    // 验证规则
    protected $rule = [
        'name'              => 'require',
        'url'              => 'require',
    ];

    // 验证提示
    protected $message = [
        'name.require'          => '链接名称不能为空',
        'url.require'          => '链接地址不能为空',
    ];

    // 应用场景
    protected $scene = [
        'add'  =>  ['name','url'],
        'edit'  => ['name','url'],
    ];
}